package com.example.estest.kafka;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * <一句话描述功能>
 * <详细功能描述>
 *
 * @author: fei
 * @date: 2020/10/17
 */
@Component
public class KafkaConsumer {
    @KafkaListener(topics = "demo")
    public void listen (ConsumerRecord<?, ?> record){
        System.out.println("-----------------------------------------------------------------------------------------");
        System.out.printf("topic is %s, offset is %d, value is %s \n", record.topic(), record.offset(), record.value());
        System.out.println("-----------------------------------------------------------------------------------------");

    }
}
